<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        const obj = {
            name: 'zs',
            age: 18,
            place: '河南省濮阳市'
        }
        for (const key in obj) {
            console.log(obj[key]);

        }
        const arr = Object.keys(obj);
        console.log(arr);
        console.log(typeof arr);

        //返回的是数组，后续操作更加灵活
        Object.keys(obj).forEach((key) => {
            console.log(key, obj[key]);

        })
        const arr1 = Object.keys(obj).filter((key) =>
            key.startsWith('a')
        )
        console.log(arr1);
        Object
            .keys(obj)
            .filter((key) =>key.startsWith('a'))
            .forEach((key) => {console.log(obj[key]);})
        const arr3 = [11,22,33]
        const arr4 = [...arr3]
        arr4.push(44)
        console.log(arr4);
        console.log(arr3);
        
        const json1 = JSON.stringify(obj)
        console.log(json1);

        const obj1 = JSON.parse(json1)
        console.log(obj1);
                
</script>
</body>

</html>